$.ajaxPrefilter(function(option) {
    option.url = 'http://127.0.0.1:3001' + option.url;
    //console.log(option.url);
    if (option.url.indexOf('/my/') != -1) {
        option.headers = {
                Authorization: localStorage.getItem('token')
            },
            option.complete = function(res) {
                //console.log(res);
                if (res.responseJSON.status === 1 && res.responseJSON.message === '身份验证失败！') {
                    localStorage.removeItem('token');
                    location.href = '/login.html';
                }
            }
    }
})